package y24.m1.homework;
public class Test2 {
    public static void main(String[] args) {
        double result = colculateLimit(10000);
        System.out.println("极限的值为：" + result);
    }
    public static double colculateLimit(int n){
        double sum = 0;
        double denominator = 2;
        for (int i = 1;i <= n;i++) {
            sum += (2 * i - 1)/denominator;
            denominator *= 2;
        }
        return sum;
    }
}


